#include<Ice/Ice.h> 
#include<IceUtil/UUID.h>

#include<string>

#include"ICE/MediaStreamServerICE.h"
#include "MediaStreamServerImp.h"


#ifdef _DEBUG
#pragma comment(lib, "Iced.lib")
#pragma comment(lib, "IceUtild.lib")
#else
#pragma comment(lib, "Ice.lib")
#pragma comment(lib, "IceUtil.lib")
#endif

using namespace std;

class MediaStreamServerApp : virtual public Ice::Application
{
public:
	virtual int run(int, char*[])
	{
 		try 
 		{
	 		::Ice::ObjectAdapterPtr ap = communicator()->createObjectAdapter("MediaStreamServer.Server"); 
	 		ap->add(new MediaStreamServerImp, communicator()->stringToIdentity("MediaStreamServer"));
	 		ap->activate();
	 		communicator()->waitForShutdown();
	 		if (interrupted())
	 		{
	 			//LOGInfo("shutting down");
	 		}
 		}
		catch(const IceUtil::Exception& ex)
		{
			string msg(ex.ice_name().c_str());
			return FALSE;
		}
		return 0;
	}
};

int main(int argc, char *argv[])
{
	MediaStreamServerApp app;
	string server = "MediaStreamServer.Server";
	app.main(__argc, __argv, server.c_str());
    return 0;
}

